
//
//  AddressManagerViewController.m
//  ShangHaiTuJI
//
//  Created by xiaoxiangtuji on 2017/8/1.
//  Copyright © 2017年 xiaoxiangtuji. All rights reserved.
//

#import "AddressManagerViewController.h"
#import "AddNewAddressViewController.h"
@interface AddressManagerViewController ()

@end

@implementation AddressManagerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"地址管理";
    [self createUI];
    // Do any additional setup after loading the view.
}

-(void)createUI{
    UIButton *addNewAddressBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [addNewAddressBtn addTarget:self action:@selector(addNewAddress:) forControlEvents:UIControlEventTouchUpInside];
    addNewAddressBtn.backgroundColor = [UIColor cyanColor];
    [addNewAddressBtn setTitle:@"添加新地址"forState:UIControlStateNormal];
    [self.view addSubview:addNewAddressBtn];
    [addNewAddressBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.and.bottom.equalTo(self.view).offset(0);
        make.height.mas_equalTo(scaleTopAndBottom(50));
        
    }];
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.backgroundColor = [UIColor redColor];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.and.right.equalTo(self.view).offset(0);
        make.top.equalTo(self.view.mas_top).offset(64);
        make.bottom.equalTo(addNewAddressBtn.mas_top);
    }];
}

-(void)addNewAddress:(UIButton *)btn{
    AddNewAddressViewController *addVc = [[AddNewAddressViewController alloc] init];
    [self.navigationController pushViewController:addVc animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
